package zip;


public class Utils {
	public static int to(byte b) {
		return (int) (b & 0xff);
	}
	
	public static StringBuffer toBuffer(byte b) {
		StringBuffer buffer = new StringBuffer();
		for (int i = 0; i < 8; ++i) {
			if ((b & 1) > 0) buffer.append('1');
			else buffer.append('0');
			b >>= 1;
		}
		return buffer.reverse(); // 注意要反转一下！
	}
}
